<?php


namespace app\api\jiarenmenpay;

class Util
{
	public static function kSortStr($paramArr)
	{
		if (empty($paramArr)) {
			return "";
		}
		ksort($paramArr);
		$str = "";
		foreach ($paramArr as $k => $v) {
			if ($v != "" && $k != "sign") {
				$str .= $k . "=" . $v . "&";
			}
		}
		return rtrim($str, "&");
	}
	public static function getSign($key, $paramArr)
	{
		return md5(self::kSortStr($paramArr) . $key);
	}
}